package edu.osu.cse.c651.cryptochess;

import java.util.ArrayList;

/**
 * A generic Piece that sits on a ChessBoard
 * 
 * @author Team Pawned
 * 
 */
public interface Piece {

	/**
	 * This tests if the movement described with the supplied parameters is
	 * legal, independent of the state of the game board
	 * 
	 * @param x1
	 *            the row of square from which the Piece will start its movement
	 * @param y1
	 *            the column of the square from which the Piece will start its
	 *            movement
	 * @param x2
	 *            the row of the square where the Piece will end its movement
	 * @param y2
	 *            the column of the square where the Piece will end its movement
	 * @return boolean true if the movement is legal according to the Piece
	 */
	public boolean legalMove(int x1, int y1, int x2, int y2);

	/**
	 * Returns a list of all possible moves that this Piece can make, dependent
	 * on the Piece and the state of the ChessBoard on which it sits. This
	 * method is used in the algorithm to check whether a Player is in check or
	 * check-mate.
	 * 
	 * @param board
	 *            the ChessBoard
	 * @param x
	 *            the row of the Piece's square
	 * @param y
	 *            the column of the Piece's square
	 * @return ArrayList<Coordinate> a list of possible ending location.
	 */
	public ArrayList<Coordinate> possibleMoves(ChessBoard board, int x, int y);

	/**
	 * The color of this Piece
	 * 
	 * @return Color the color of this Piece
	 */
	public Color color();

	/**
	 * The name of this Piece
	 * 
	 * @return PieceName the name of this Piece
	 */
	public PieceName name();

	/**
	 * Increments total moves by this Piece by one
	 */
	public void movesPlusOne();

	/**
	 * Returns the number of moves this Piece has made
	 * 
	 * @return int the number of moves this Piece has made
	 */
	public int moveCount();

}
